//
//  Adapter.cpp
//  SeparableSSS
//
//  Created by yushroom on 8/18/15.
//  Copyright (c) 2015 yushroom. All rights reserved.
//

#include "Adapter.h"

void init(int width, int height, GLKView* view)
{
    glClearColor(0, 0.4, 0.5, 0);
    
    ssssRender = new SSSSRender;
    ssssRender->initialize(width, height, view);
}

void render()
{
    ssssRender->update(0);
    ssssRender->render();
}

void enable_ssss(bool enabled)
{
    ssssRender->set_enable_ssss(enabled);
}

void enable_bloom(bool enabled)
{
    ssssRender->set_enable_bloom(enabled);
}

void enable_dof(bool enabled)
{
    ssssRender->set_enable_dof(enabled);
}

void enable_film_grain(bool enabled)
{
    ssssRender->set_enable_film_grain(enabled);
}

void print_time()
{
    ssssRender->print_time();
}

void rotate()
{
    static bool enabled = false;
    ssssRender->set_enable_rotate(enabled);
    enabled = !enabled;
}

void touch_begin(float x, float y)
{
    ssssRender->touch_begin(x, y);
}

void touch_move(float x, float y)
{
    ssssRender->touch_move(x, y);
}

void touch_end()
{
    ssssRender->touch_end();
}

void scale(float s)
{
    ssssRender->scale(s);
}
